package liuliu.throughwaring.ui.activity;

import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;

import net.tsz.afinal.annotation.view.CodeNote;

import liuliu.custom.control.toolbar.TToolbar;
import liuliu.throughwaring.R;
import liuliu.throughwaring.base.BaseActivity;
import liuliu.throughwaring.control.onload.OnloadListener;

/**
 * Created by liuliu on 2015/11/20   10:02
 * 联网查询
 *
 * @author 柳伟杰
 * @Email 1031066280@qq.com
 */
public class OnLineSearchActivity extends BaseActivity {
    @CodeNote(id = R.id.online_index)
    LinearLayout onlineIndex;
    @CodeNote(id = R.id.online_person_search)
    LinearLayout personSearch;
    String controller;
    Intent intent;
    @CodeNote(id = R.id.online_search_toolbar)
    TToolbar ttollbar;

    @Override
    public void initViews() {
        intent = new Intent();
        setContentView(R.layout.activity_online_search);
        onlineIndex.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                controller = "Index";
                post();
            }
        });
        personSearch.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                controller = "SearchPerson";
                post();
            }
        });
    }

    private void post() {
        intent.setClass(OnLineSearchActivity.this, OnLineLoadUrlActivity.class);
        intent.putExtra("Controler", controller);
        startActivity(intent);
    }

    @Override
    public void initEvents() {
        ttollbar.setLeftOnClick(new TToolbar.LeftOnClickListener() {
            @Override
            public void leftclick() {
                OnLineSearchActivity.this.finish();
            }
        });
    }

}
